﻿using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using ObjectModel;

namespace DataAccess
{
    class UserConfiguration : EntityTypeConfiguration<User>
    {
        public UserConfiguration()
        {
            Property(p => p.Id).IsRequired().HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            HasMany(p => p.Roles).WithMany(p => p.Users);
        }
    }
}
